import request from '@/utils/request/request';
import requestForFile from '@/utils/request/requestForFile';
// import {
//   APIAddParams,
//   APIDetailInfo,
//   APIListRes,
//   APIParams,
//   ExecuteAPI,
// } from '@/api/infrastructure/model/apiModal';

// 分页查询供应商到货API数据
export function getPmsReceivePage(params: any) {
  return request.get('/api/procurement/order/receive/page', {
    params,
  });
}
// 新增供应商到货API
export function savePmsReceive(data: any) {
  return request.post('/api/procurement/order/receive', data);
}

// 修改供应商到货API
export function editPmsReceive(data: any) {
  return request.put('/api/procurement/order/receive', data);
}

// 根据供应商到货APIid查API详细信息
export function getPmsReceiveDetailInfoById(id: string) {
  return request.get(`/api/procurement/order/receive/${id}`);
}

// 删除供应商到货API
export function deletePmsReceive(id: string) {
  return request.delete(`/api/procurement/order/receive/${id}`);
}

// 分页查询采购到货装箱单到货API数据
export function getPmsReceiveBoxPage(params: any) {
  return request.get('/api/procurement/order/receive-box/page', {
    params,
  });
}
// 新增采购到货装箱单到货API
export function savePmsReceiveBox(data: any) {
  return request.post('/api/procurement/order/receive-box', data);
}

// 修改采购到货装箱单API
export function editPmsReceiveBox(data: any) {
  return request.put('/api/procurement/order/receive-box', data);
}

// 根据采购到货装箱单APIid查API详细信息
export function getPmsReceiveBoxDetailInfoById(id: string) {
  return request.get(`/api/procurement/order/receive-box/${id}`);
}

// 删除采购到货装箱单API
export function deletePmsReceiveBox(id: string) {
  return request.delete(`/api/procurement/order/receive-box/${id}`);
}

// 分页查询采购到货装箱单到货明细API数据
export function getPmsReceiveDetailPage(params: any) {
  return request.get('/api/procurement/order/receive-detail/page', {
    params,
  });
}
// 新增采购到货装箱单明细到货API
export function savePmsReceiveDetail(data: any) {
  return request.post('/api/procurement/order/receive-detail', data);
}
// 新增采购到货装箱单明细到货API
export function saveAllPmsReceiveDetail(data: any) {
  return request.post(
    '/api/procurement/order/receive-detail/saveReceiveDetailAll',
    data
  );
}

// 修改采购到货装箱单明细API
export function editPmsReceiveDetail(data: any) {
  return request.put('/api/procurement/order/receive-detail', data);
}

// 根据采购到货装箱单明细APIid查API详细信息
export function getPmsReceiveDetailDetailInfoById(id: string) {
  return request.get(`/api/procurement/order/receive-detail/${id}`);
}

// 删除采购到货装箱单明细API
export function deletePmsReceiveDetail(id: string) {
  return request.delete(`/api/procurement/order/receive-detail/${id}`);
}

// 采购订单详情
export function getPmsOrderDetailPage(params) {
  return request.get(`/api/procurement/order/order-detail/page`, {
    params,
  });
}
// 采购订单列表
export function getPmsOrderDetailPageReceive(params) {
  return request.get(`/api/procurement/order/order-detail/pageReceive`, {
    params,
  });
}
// 到货确认并登记协同
export function receiveCheckSave(data: any) {
  return request.post(
    '/api/procurement/order/receive-accept/receiveCheckSave',
    data
  );
}
// 预到货到货确认
export function arrivalConfirmation(data: any) {
  return request.put(
    '/api/procurement/order/receive/arrivalConfirmation',
    data
  );
}
// 撤销确认
export function revokeConfirmation(data: any) {
  return request.put('/api/procurement/order/receive/revokeConfirmation', data);
}
// 导出
export function exportPmsReceiveDetail(params: any) {
  return requestForFile.get('/api/procurement/order/receive-detail/export', {
    params,
    responseType: 'blob',
  });
}
